﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CIIS.Common;
using DevExpress.XtraEditors;

namespace CIIS
{
    public partial class SeuspectManage : Manage
    {
        protected bool queryFlag = false;

        public SeuspectManage(bool onlyForQuery)
        {
            queryFlag = onlyForQuery;
            InitializeComponent();
            InitUserControl();
        }

        public SeuspectManage()
        {
            InitializeComponent();

            InitUserControl();
        }

        protected void InitUserControl()
        {
            if (!queryFlag)
            {
                InitButtonsWithEvent(new string[] { "添加" }, new EventHandler[] { btnAdd_click });
            }

            InitParamControl(new bool[] { true, false, true, false, true, false },
                new string[] { "人员ID：", "", "姓名：", "", "身份证号：", "" },
                new DropdownControlParam[] { null, null, null, null, null, null });

            InitGridViewDataColumns(new string[] { "选中", "序号", "人员ID", "姓名", "身份证号", "性别", "出生年月", "籍贯", "职业" },
                new string[] { "IsSelected", "", "", "", "", "", "", "", "" },
                null);

            if (queryFlag)
            {
                InitGridViewOptColumnWithEvent(new string[] { "详情" },
                    new EventHandler[] { linkDetail_click });
            }
            else
            {
                InitGridViewOptColumnWithEvent(new string[] { "详情", "修改", "删除" },
                    new EventHandler[] { linkDetail_click, linkDetail_click, linkDelete_click });
            }
        }

        void btnAdd_click(object sender, EventArgs ent)
        {
            Seuspect dlg = new Seuspect();
            dlg.OptType = EOperateType.Add;
            dlg.ShowDialog();
        }
        void linkDetail_click(object sender, EventArgs ent)
        {
            Seuspect dlg = new Seuspect();
            dlg.OptType = EOperateType.Detail;
            dlg.ShowDialog();
        }
        void linkModify_click(object sender, EventArgs ent)
        {
            Seuspect dlg = new Seuspect();
            dlg.OptType = EOperateType.Modify;
            dlg.ShowDialog();
        }
        void linkDelete_click(object sender, EventArgs ent)
        {
        }
    }
}
